package com.yunkeji.config.properties;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 读取项目相关配置
 *
 * @author 老张
 */
@Data
@Configuration
@ToString
@ConfigurationProperties(prefix = "pay")
@EnableConfigurationProperties(PayProperties.class)
public class PayProperties {

    private Ali ali = new Ali();
    private Apple apple = new Apple();
    private Wx wx = new Wx();

    @Data
    @ToString
    @NoArgsConstructor
    @AllArgsConstructor
    public class Ali {
        private String appid;
        private String aliPayPublicKey;
        private String privateKey;
        private String notifyUrl;
        private String serviceUrl;
        private String appidTwo;
        private String aliPayPublicKeyTwo;
        private String privateKeyTwo;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @AllArgsConstructor
    public class Wx {
        private String appid;
        private String partnerKey;
        private String certPath;
        private String notifyUrl;
        private String mchId;
        private String appidTwo;
        private String certPathTwo;
        private String mchIdTwo;
        private String apiKey;
        private String secret;
    }

    @Data
    @ToString
    @NoArgsConstructor
    @AllArgsConstructor
    public class Apple {
        private String appid;
        private String applePublicKey;
        private String privateKey;
    }
}
